package net.ljh.service;

import net.ljh.bean.User;
import net.ljh.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {

    @Resource
    UserMapper userMapper;

    public User login(String name,String password){

        User user=new User();
        user.setName(name);
        user.setPassword(password);
        User userinfo=userMapper.login(user);
        return userinfo;
    }

    public boolean update(User user){
        try {
            userMapper.update(user);
            return true;
        }catch (Exception e){
            e.printStackTrace();
            return false;
        }


    }
}
